<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-畅销商品管理">
</@frame.head>
<link rel="stylesheet" type="text/css" href="${contextPath}/resources/css/search_table.css" />
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 商品管理 <span class="c-gray en">&gt;</span> 商品评价管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
			<div class="panel panel-default mt-20">
				
				<div class="panel-body">
					<div id="HuiTab-demo1" class="HuiTab">
						<div class="tabBar cl">
							<span>评价管理</span>
							<span>评价设置</span>
							
						</div>
						<div class="tabCon">
<div class="page-container">

   <div class="text-c">
    <form action="${contextPath}/productComment/query_comment_list" method="post" name="search_form" id="search_form">
       <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />  
       <table class="table search_table" >
										<tr>
											<td class="form_label">

												<label for="">
													会员卡号：
												</label>
											</td>
											<td>
												<input id="memberNo" class="input-text  radius"
													name="memberNo" type="text" maxlength="21"
													value="${productCommentQo.memberNo}" 
													onkeyup='this.value=this.value.replace(/\D/g,"")'/>

											</td>
											<td class="form_label">

												<label for="">
													商品编号：
												</label>
											</td>
											<td>
												<input id="productId" class="input-text  radius"
													name="productId" type="text" maxlength="21"
													value="${productCommentQo.productId}" 
													onkeyup='this.value=this.value.replace(/\D/g,"")'/>

											</td>

											 <td class="form_label">
												<label for="">
													商品名称：
												</label>
											</td>
											<td>
												<input id="productName" class="input-text  radius"
													name="productName" type="text"
													value="${productCommentQo.productName}" />
											</td>
											</tr>
											<tr>
																					<td class="form_label">

												<label for="">
													订单编号：
												</label>
											</td>
											<td>
												<input id="orderNo" class="input-text  radius"
													name="orderNo" type="text" maxlength="21"
													value="${productCommentQo.orderNo}" 
													onkeyup='this.value=this.value.replace(/\D/g,"")'/>

											</td>
											<td class="form_label">

												<label for="">
													商品类型：
												</label>
											</td>
														<td width="300px">
											<span class="select-box radius">
											<input id="changeTypesHidden" type="hidden" value="${productCommentQo.type}"/> <!-- 存储查询刷新页面之后，咨询类型的值 -->
											<select  id="productType" name="productType" class="select">
										<option  value="">全部</option>
                                        <option <#if productCommentQo.productType==1> selected="selected" </#if>  value="1">实物商品
                                        </option>
                                        <option <#if productCommentQo.productType==2> selected="selected" </#if> value="2">虚拟商品
                                        </option>
                                        <option <#if productCommentQo.productType==3> selected="selected" </#if> value="3">机票优惠券
                                        </option>
                                        <option <#if productCommentQo.productType==4> selected="selected" </#if> value="4">其他-购票资质
                                        </option>
                                        <option <#if productCommentQo.productType==5> selected="selected" </#if> value="5">其他-升舱资质
                                        </option>
											</select>
											</span>
											</td>

											 <td class="form_label">
												<label for="">
													商户名称：
												</label>
											</td>
															<td width="300px">
												<span class="select-box radius">
											<select  id="merchantId" name="merchantId" class="select">
										<option  value="">全部</option>
                                  <#list merchantList as list>  
                 					<option value="${list.id?c}" <#if list.id==productCommentQo.merchantId>selected="selected"</#if> >${list.mercName}</option>
                 				  </#list>  
											</select>
											</span>
											</td>
											
											
											
											</tr>
											<tr>
											<td class="form_label">
												<label for="">
													评价时间：
												</label>
											</td>
											<td>
		
												<input  type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'askDateEnd\')}',readOnly: true })" id="askDateStart" 
									               value='${(productCommentQo.askDateStart?string("yyyy-MM-dd"))!}' name="askDateStart"  class="input-text Wdate" style="width:45%;">
									                                                至
									               <input  type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'askDateStart\')}',readOnly: true })" id="askDateEnd" 
									               value='${(productCommentQo.askDateEnd?string("yyyy-MM-dd"))!}' name="askDateEnd"    class="input-text Wdate" style="width:45%;">

											</td>
														<td class="form_label">

												<label for="">
													审核状态：
												</label>
											</td>
											<td>
											<span class="select-box radius">
											<select  id="examineStatus" name="examineStatus" class="select">
										<option  value="">全部
                                        </option>
                                        <option <#if productCommentQo.examineStatus==1> selected="selected" </#if>  value="1">未审核
                                        </option>
                                        <option <#if productCommentQo.examineStatus==2> selected="selected" </#if> value="2"  >审核通过
                                        </option>
                                        <option <#if productCommentQo.examineStatus==3> selected="selected" </#if> value="3"  >审核驳回
                                        </option>
											</select>
											</span>
											</td>
										<td class="form_label">

												<label for="">
													显示状态：
												</label>
											</td>
											<td>
											<span class="select-box radius">
											<select  id="showStatus" name="showStatus" class="select">
										<option  value="">全部
                                        </option>
                                        <option <#if productCommentQo.showStatus==1> selected="selected" </#if>  value="1">已显示
                                        </option>
                                        <option <#if productCommentQo.showStatus==2> selected="selected" </#if> value="2"  >已隐藏
                                        </option>
                                        <option <#if productCommentQo.showStatus==3> selected="selected" </#if> value="3"  >已顶置
                                        </option>
											</select>
											</span>
											</td>
											</tr>
											<tr>
											<td class="form_label">

												<label for="">
													商品评分：
												</label>
											</td>
											<td>
											<span class="select-box radius">
											<select  id="score" name="score" class="select">
										<option  value="">全部
                                        </option>
                                        <option <#if productCommentQo.score==1> selected="selected" </#if> value="1">1
                                        </option>
                                        <option <#if productCommentQo.score==2> selected="selected" </#if> value="2">2
                                        </option>
                                        <option <#if productCommentQo.score==3> selected="selected" </#if> value="3">3
                                        </option>
                                        <option <#if productCommentQo.score==4> selected="selected" </#if> value="4">4
                                        </option>
                                        <option <#if productCommentQo.score==5> selected="selected" </#if> value="5">5
                                        </option>
            
											</select>
											</span>

											</td>
										<td class="form_label">

												<label for="">
													是否附图：
												</label>
											</td>
											<td>
											<span class="select-box radius">
											<select  id="isPic" name="isPic" class="select">
										<option  value="">全部
                                        </option>
      										<option <#if productCommentQo.isPic==1> selected="selected" </#if>  value="1">有图
                                        </option>
                                        <option <#if productCommentQo.isPic==0> selected="selected" </#if>  value="0">无图
                                        </option>
											</select>
											</span>
											</td>

											</tr>

<tr>
											<td class="filter_btn" colspan="6" align="center">
												<input class="btn btn-success radius" type="button" value="查询" onclick="submit()"/>
												<input class="btn btn-success radius" type="button" onclick="clean()" value="重置"/>
												<input class="btn btn-success radius" type="button" value="刷新" onclick="javascript:location.replace(location.href);"/>
											</td>
										</tr>
      </table>
     </form>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"> 

    <span class="r">共有数据：<strong>${pagination.totalCount}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr  class="text-c">
            <th >商品编号</th>
            <th >商品名称</th>
            <th >商品评分</th>
            <th >评价内容</th>
            <th >评价时间</th>
            <th >审核状态</th>
            <th >显示状态</th>
            <th >操作</th>
        </tr>
        </thead>
        <tbody >
         <#list pagination.list as list> 
         <tr  class="text-c">
            <td>${list.product.id}</td>
            <td>${list.product.baseInfo.name}</td>
            <td>${list.score}</td>
            <td width="20%"> 			
            <#if list.isPic>
				【图】
			</#if>
			${list.content}</td>
            <td>${(list.askDate?string("yyyy-MM-dd HH:mm:ss"))!}</td>
            <td>
 			<#if list.examineStatus==2>
				审核通过
			</#if>
			<#if list.examineStatus==1>
				未审核&nbsp;
			</#if>
			<#if list.examineStatus==3>
				审核驳回
			</#if>
			</td>
            <td>
            <#if list.showStatus==2>已隐藏
            <#else>已显示
            </#if></td>
            <td>
			<a href="javaScript:void(0)" onclick="examine('${list.id}')">审核</a><br />
			<a href="javaScript:void(0)" onclick="look('${list.id}')">查看</a><br />
			<#if list.showStatus==2>
			<a href="javaScript:void(0)" onclick="show('${list.id}')">显示</a><br />
			<#else>
			<a href="javaScript:void(0)" onclick="show('${list.id}')">隐藏</a><br />
			</#if>

            </td>
         </tr>
         </#list>
        </tbody>
    </table>
    <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>


						</div>
						<div class="tabCon">	
<div class="page-container">
<form method="post" name="query_business_form"  id="query_business_form" action="${contextPath}/productComment/update_productCommentSetting" >    

         <table style="margin-top: 20px;" class="table table-bg">
           	<tr >
            <td>			
			<select onchange="change()"  id="commentStatus" name="commentStatus" >
		

                                <option value="2">关闭
                                        </option>
                                <option  <#if productCommentSetting.status==1> selected="selected" </#if> value="1">开启
                                        </option>
        
			</select>商品评价&nbsp;&nbsp;
            <label class="typechange"><input type="checkbox" name="type1" value="1" <#if productCommentSetting.type1 == 1> checked="checked" </#if> >实物商品 </label> &nbsp;&nbsp;
			<label class="typechange"><input name="type2" type="checkbox" value="1" <#if productCommentSetting.type2 == 1> checked="checked" </#if> >虚拟商品 </label> &nbsp;&nbsp;
			<label class="typechange"><input name="type3" type="checkbox" value="1" <#if productCommentSetting.type3 == 1> checked="checked" </#if> >机票优惠券</label> &nbsp;&nbsp;
			<label class="typechange"><input name="type4" type="checkbox" value="1" <#if productCommentSetting.type4 == 1> checked="checked" </#if> >其他-购票资质</label> &nbsp;&nbsp;
			<label class="typechange"><input name="type5" type="checkbox" value="1" <#if productCommentSetting.type5 == 1> checked="checked" </#if> >其他-升舱资质 </label>&nbsp;&nbsp;
			<label class="typechange"><input name="type6" type="checkbox" value="1" <#if productCommentSetting.type6 == 1> checked="checked" </#if> >公益产品 </label>  &nbsp;&nbsp;
            
            </td>
        	</tr>
        	           	<tr >
            <td>			
			<select  id="memberStatus" name="memberStatus" >
		
                                <option value="2">隐藏
                                        </option>
                                <option <#if productCommentSetting.memberStatus==1> selected="selected" </#if>  value="1">显示
                                        </option>
        
			</select>
            会员中心——我的评价
            </td>
        	</tr>
        	           	<tr >
            <td>			
			<select  id="openSensitiveWords" name="openSensitiveWords" >
		
                                <option   value="2">禁用
                                        </option>
                                <option <#if productCommentSetting.openSensitiveWords==1> selected="selected" </#if>  value="1">启用
                                        </option>
        
			</select>
            敏感词汇库
            </td>
        	</tr>

           <tr>
               <td>
                   <input class="btn btn-success radius" type="submit" value="修改"/>
               </td>
           </tr>
         </table>
</form>
                            <div style="border-top: 2px solid #ddd;">
                                <table class="monitor_log">
                                    <tr>
                                        <td>
                                            最后修改人：${productCommentSetting.userName }
                                        </td>
                                        <td>
                                            修改时间：${(productCommentSetting.lastTime?string("yyyy-MM-dd HH:mm:ss"))!}
                                            
                                        </td>
                                    </tr>
                                </table>
                            </div>
</div>
						</div>
<@frame.end "default">
</@frame.end>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/new_arrival_product/query_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
            $("#page").val(obj.curr);
            $("#search_form").submit();
        }
    }
});

//选项卡
$("#HuiTab-demo1").Huitab({
	index:0
});
function change(){
	
	var status=$("#commentStatus").val();
	if(status==2){
		$(".typechange").hide();
	}else{
		$(".typechange").show();
	}
	   
}
$(function(){  
		var status=$("#commentStatus").val();
		if(status==2){
			$(".typechange").hide();
		}else{
			$(".typechange").show();
		}

}); 
function show(id){
	$.ajax({
	     url:path+"/productComment/show",
	     type:"post",
	     data:{"QuestionId":id},
	     dataType:"text",
	     beforeSend:function(){},
	     error:function(XMLHttpRequest,textStatus,errorThrown){
	    	 submitForm();
	     },
	     success:function(msg){
	    	 submitForm();
	     	
	      }
	     });
}
//审核
function examine(id){
    var index = layer.open({
        type: 2,
        title: '审核',
        scrollbar: false,
        content: path+"/productComment/to_examine?ProductCommentId="+id,
        area: ['600px', '500px']
    });

	
}
function submitForm(){

	$("#search_form").submit();
}
function clean(){
	document.getElementsByName("memberNo")[0].value = "";
	document.getElementsByName("productId")[0].value = "";
	document.getElementsByName("productName")[0].value = "";
	document.getElementsByName("orderNo")[0].value = "";
	document.getElementsByName("productType")[0].value = "";
	document.getElementsByName("merchantId")[0].value = "";
	document.getElementsByName("askDateStart")[0].value = "";
	document.getElementsByName("askDateEnd")[0].value = "";
	document.getElementsByName("examineStatus")[0].value = "";
	document.getElementsByName("showStatus")[0].value = "";
	document.getElementsByName("score")[0].value = "";
	document.getElementsByName("isPic")[0].value = "";
	
}
//查看
function look(id){
    var index = layer.open({
        type: 2,
        title: '查看',
        scrollbar: false,
        content: path+"/productComment/look?ProductCommentId="+id,
        area: ['550px', '500px']
    });

	
}

</script>